home *** CD-ROM | disk | FTP | other *** search
/ Top 200 Programs / Top 200 Programs.iso / Bob8 / THOMPSON / LIBERTY / PRODUCT / TUTORIAL.EXE / WK5SOL.BAS < prev    next >
BASIC Source File  |  1996-04-01  |  1KB  |  60 lines

  1.  
  2.  
  3.     'WK5SOL.BAS
  4.     'Week 5 Liberty BASIC Course
  5.     'Copyright 1996 Shoptalk Systems
  6.     'All Rights Reserved
  7.     'Here is our solution for week 5 of our Liberty BASIC course
  8.     '------------------------------------------------------------------
  9.  
  10.     'load our bitmaps
  11.     loadbmp "letter", "letter.bmp"
  12.     loadbmp "call", "call.bmp"
  13.     loadbmp "brochure", "brochure.bmp"
  14.     loadbmp "sale", "sale.bmp"
  15.  
  16.     'setup our listbox choices
  17.     dim status$(4)
  18.     status$(0) = "letter"
  19.     status$(1) = "call"
  20.     status$(2) = "brochure"
  21.     status$(3) = "sale"
  22.  
  23.     'no main window
  24.     nomainwin
  25.  
  26.     'size the window
  27.     WindowWidth = 200
  28.     WindowHeight = 150
  29.  
  30.     'setup our controls and open the window
  31.     statictext #main, "Select Status:", 10, 10, 120, 20
  32.     listbox #main.status, status$(, [loop], 10, 35, 120, 60
  33.     graphicbox #main.draw, 140, 35, 34, 34
  34.     open "Week 5 Homework" for dialog as #main
  35.     print #main, "trapclose [quit]"
  36.  
  37.     'tell the listbox where to branch on a single-click
  38.     print #main.status, "singleclickselect [statusSelected]"
  39.  
  40.  
  41. [loop]  'wait here for user input
  42.     input r$
  43.     goto [loop]
  44.  
  45.  
  46. [statusSelected]  'draw the icon for the selected status
  47.  
  48.     print #main.status, "selection?"
  49.     input #main.status, selectedStatus$
  50.  
  51.     print #main.draw, "cls ; drawbmp "; selectedStatus$; " 0 0"
  52.  
  53.     goto [loop]
  54.  
  55.  
  56. [quit]  'exit the program
  57.  
  58.     close #main
  59.     end
  60.